<?php
// 连接数据库文件
header('content-type:text/html;charset=utf8');
$link = mysqli_connect('localhost','root','root','project');

// 获取所有的景点信息
$res = mysqli_query($link,"SELECT * FROM scenics");
$arr = [];
while($row = mysqli_fetch_assoc($res)){
    $arr[] = $row;
}
echo json_encode([
    "meta"=>[
        "status"=>0,
        "msg"=>"数据获取成功"
    ],
    "data"=>$arr
]);